﻿@using DIS.Infrastructure.Entities.Entity;
@using DIS.Infrastructure.Entities.Enum;
@{
    ViewBag.Title = "用户明细";
    Layout = "~/Views/Shared/_Layout.cshtml";
    User user = ViewBag.User;
}

<table width="98%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#D6D6D6">
        <tr>
            <td height="19" background="/content/img/tbg.gif" bgcolor="#E7E7E7">
                <table width="96%" border="0" cellspacing="1" cellpadding="1">
                    <tr>
                        <td style="padding-left: 10px;">
                            <b><strong>添加用户</strong></b>
                        </td>
                        <td align="right">
                            <b><strong><a href="/account/users">用户列表</a></strong></b>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center" valign="top" bgcolor="#FFFFFF">
                <form name="saveuserForm" action="/account/SaveUser" method="post">
               
                @{
                    if (user != null)
                    {
                         <input type="hidden" name="Id" id="id" value="@user.Id" />
                        <table width="98%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>登录账号：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="username" type="text" id="username" size="16" readonly="readonly" value="@user.UserName" style="width: 200px" />
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>真实姓名：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="RealName" type="text" id="RealName" size="16"  value="@user.RealName"  style="width: 200px" />
                        </td>
                    </tr>
                     <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>专业所：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="ProfessionName" type="text" id="ProfessionName" size="16"  value="@user.ProfessionName"  style="width: 200px" />
                        </td>
                    </tr>
                     <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>部门：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="RealNDepartMentNameame" type="text" id="DepartMentName" size="16"  value="@user.DepartMentName"  style="width: 200px" />
                        </td>
                    </tr>
                    <tr>
                        <td height="30" align="right">
                            性别：
                        </td>
                        <td style="text-align: left;">
                            @{
                        if (user.Gender == Gender.Male)
                        {
                                    <input name="Gender" type="radio" id="man" value='1' checked />
                                    <label for="man">
                                        &nbsp;男</label>
                                    <input name="Gender" type="radio" id="woman" value='0' /><label for="woman">
                                        &nbsp;女</label>
                        }
                        else
                        {
                                    <input name="Gender" type="radio" id="man" value='1'/>
                                <label for="man">
                                    &nbsp;男</label>
                                <input name="Gender" type="radio" id="woman" value='0' checked /><label for="woman">
                                &nbsp;女</label>
                        }
                            }
                            
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>出生日期：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="Birthday" type="text" id="Birthday" readonly="readonly" value="@user.Birthday" size="16" style="width: 200px" onClick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" />
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" height="30" align="right">
                            QQ：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="QQ" type="text" id="QQ" size="16"  value="@user.QQ"  style="width: 200px" />
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>电话：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="Phone" type="text" id="Phone" size="16"  value="@user.Phone"  style="width: 200px" />
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" height="30" align="right">
                            身份证号：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="IdCardNo" type="text" id="IdCardNo" size="16"  value="@user.IdCardNo"  style="width: 200px" />
                        </td>
                    </tr>
                    <tr>
                        <td height="30" align="right">
                            职位：
                        </td>
                        <td style="text-align: left;">
                             <select name="SystemRole" style="width: 150px;">
                                @{
                        if (user.SystemRole == UserRole.Leader)
                        {
                                        <option value="1">普通员工</option>
                                                <option value="11" selected="selected">领导</option>
                        }
                        else
                        {
                            <option value="1"  selected="selected">普通员工</option>
                                                <option value="11">领导</option>
                        }
                                    }
                                    
                                </select>
                        </td>
                    </tr>
                     <tr>
                        <td height="30" align="right">
                            是否有效：
                        </td>
                        <td style="text-align: left;">
                        @{
                        if (user.IsActivate)
                        {
                            <input name="IsActivate" type="radio" id="Activate" value='1'  checked/>
                            <label for="man">
                                &nbsp;正常</label>
                            <input name="IsActivate" type="radio" id="NoActivate" value='0' /><label for="woman">
                                &nbsp;禁用</label>
                        }
                        else
                        {
                            <input name="IsActivate" type="radio" id="Activate" value='1' />
                            <label for="man">
                                &nbsp;正常</label>
                            <input name="IsActivate" type="radio" id="NoActivate" value='0'  checked  /><label for="woman">
                                &nbsp;禁用</label>
                        }
                    }
                            
                        </td>
                    </tr>
                    <tr> 
            <td height="60">&nbsp;</td>
            <td align="left">
            	<input type="submit" name="submit" value="保存" class="coolbg np" />
            </td>
          </tr>
                </table>
                    }
                    else
                    {
                         <input type="hidden" name="Id" id="id" value="0" />
                        <table width="98%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>登录账号：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="username" type="text" id="username" size="16" value="" style="width: 200px" />
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>真实姓名：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="RealName" type="text" id="RealName" size="16"  value=""  style="width: 200px" />
                        </td>
                    </tr>
                     <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>专业所：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="ProfessionName" type="text" id="ProfessionName" size="16"  value=""  style="width: 200px" />
                        </td>
                    </tr>
                     <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>部门：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="DepartMentName" type="text" id="DepartMentName" size="16"  value=""  style="width: 200px" />
                        </td>
                    </tr>
                    <tr>
                        <td height="30" align="right">
                            性别：
                        </td>
                        <td style="text-align: left;">
                            <input name="Gender" type="radio" id="man" value='1' checked />
                            <label for="man">
                                &nbsp;男</label>
                            <input name="Gender" type="radio" id="woman" value='0' /><label for="woman">
                                &nbsp;女</label>
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>出生日期：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="Birthday" type="text" id="Birthday" readonly="readonly" size="16" style="width: 200px" onClick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd'})" />
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" height="30" align="right">
                            QQ：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="QQ" type="text" id="QQ" size="16"  value=""  style="width: 200px" />
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" height="30" align="right">
                            <span class='red'>*</span>电话：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="Phone" type="text" id="Phone" size="16"  value=""  style="width: 200px" />
                        </td>
                    </tr>
                    <tr>
                        <td width="16%" height="30" align="right">
                            身份证号：
                        </td>
                        <td width="84%" style="text-align: left;">
                            <input name="IdCardNo" type="text" id="IdCardNo" size="16"  value=""  style="width: 200px" />
                        </td>
                    </tr>
                    <tr>
                        <td height="30" align="right">
                            职位：
                        </td>
                        <td style="text-align: left;">
                             <select name="SystemRole" style="width: 150px;">
                                    <option value="1"  selected="selected">普通员工</option>
                                    <option value="11">领导</option>
                                </select>
                        </td>
                    </tr>
                     <tr>
                        <td height="30" align="right">
                            是否有效：
                        </td>
                        <td style="text-align: left;">
                            <input name="IsActivate" type="radio" id="Activate" value='1' checked />
                            <label for="man">
                                &nbsp;是</label>
                            <input name="IsActivate" type="radio" id="NoActivate" value='0' /><label for="woman">
                                &nbsp;否</label>
                        </td>
                    </tr>
                    <tr> 
            <td height="60">&nbsp;</td>
            <td align="left">
            	<input type="submit" name="submit" value="保存" class="coolbg np" />
            </td>
          </tr>
                </table>
                    }
                }
                
                </form>
            </td>
        </tr>
    </table>
    @section tail{
    <script type="text/javascript" src="/scripts/jquery.js"></script>
    <script type="text/javascript" src="/Scripts/plug.js"></script>
    
 <script type="text/javascript" src="/Scripts/jquery.validate.js"></script>
    <script type="text/javascript" src="/Scripts/jquery.metadata.js"></script>
 <script type="text/javascript">
     
      
    </script>
}
